#!/bin/bash

echo "starting script...."
q=1
bname=".jpg"
for files in `ls`
do
	fname=${files:0-4}
	if [ $fname = ".jpg" ]; then
		echo "Processing ..."
		head=$(echo $q)
		echo "Head: " "p"$head
		name="p"$head$bname
		mv $files $name
		let "q = $q + 1"
		sleep 1
	else
		echo "Escape" $file
		sleep 1
	fi
done
exit 0

